package org.agile2soft.nexoma.expedient.entity;

// Generated 15-jul-2009 20:59:18 by Hibernate Tools 3.2.4.GA

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.agile2soft.nexoma.core.entity.EntryReg;
import org.agile2soft.nexoma.core.entity.InternalUser;

@Entity
@Table(name = "EXPEDIENT_DOCUMENT")
@SuppressWarnings({"serial"})
public class ExpedientDoc implements java.io.Serializable {

    private Integer id;
    private EntryReg entryReg;
    private InternalUser internalUser;
    private Expedient expedients;
    private boolean visible;
    private byte[] content;
    private Date createDate;
    private int size;
    private String realname;
    private String desscription;
    private String mime;
    private String title;
    private String keys;

    public ExpedientDoc() {
    }

    public ExpedientDoc(boolean visible, byte[] content,
            Date createDate, int size, String realname,
            String mime) {
        this.visible = visible;
        this.content = content;
        this.createDate = createDate;
        this.size = size;
        this.realname = realname;
        this.mime = mime;
    }

    public ExpedientDoc(EntryReg entryReg,
            InternalUser internalUser, Expedient expedient,
            boolean visible, byte[] content, Date createDate,
            int size, String realname,
            String description, String mime, String title,
            String keys) {
        this.entryReg = entryReg;
        this.internalUser = internalUser;
        this.expedients = expedient;
        this.visible = visible;
        this.content = content;
        this.createDate = createDate;
        this.size = size;
        this.realname = realname;
        this.desscription = description;
        this.mime = mime;
        this.title = title;
        this.keys = keys;
    }

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "EXP_DOC_ID", unique = true, nullable = false)
    public Integer getId() {
        return this.id;
    }

    public void setId(Integer expDocId) {
        this.id = expDocId;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "REG_ID")
    public EntryReg getEntryReg() {
        return this.entryReg;
    }

    public void setEntryReg(EntryReg entryReg) {
        this.entryReg = entryReg;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "USU_LOGIN")
    public InternalUser getInternalUser() {
        return this.internalUser;
    }

    public void setInternalUser(InternalUser internalUser) {
        this.internalUser = internalUser;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "EXP_ID")
    public Expedient getExpedients() {
        return this.expedients;
    }

    public void setExpedients(Expedient expedients) {
        this.expedients = expedients;
    }

    @Column(name = "EXP_DOC_VISIBLE", nullable = false)
    public boolean isVisible() {
        return this.visible;
    }

    public void setVisible(boolean visible) {
        this.visible = visible;
    }

    @Column(name = "EXP_DOC_CONTENT", nullable = false)
    public byte[] getContent() {
        return this.content;
    }

    public void setContent(byte[] content) {
        this.content = content;
    }

    @Temporal(TemporalType.DATE)
    @Column(name = "EXP_CREATE_DATE", nullable = false, length = 10)
    public Date getCreateDate() {
        return this.createDate;
    }

    public void setCreateDate(Date createDAte) {
        this.createDate = createDAte;
    }

    @Column(name = "EXP_DOC_TAMANYO", nullable = false)
    public int getSize() {
        return this.size;
    }

    public void setSize(int size) {
        this.size = size;
    }

    @Column(name = "EXP_DOC_REAL_NAME", nullable = false, length = 254)
    public String getRealname() {
        return this.realname;
    }

    public void setRealname(String realname) {
        this.realname = realname;
    }

    @Column(name = "EXP_DOC_DESCRIPTION", length = 254)
    public String getDescription() {
        return this.desscription;
    }

    public void setDescription(String description) {
        this.desscription = description;
    }

    @Column(name = "EXP_DOC_MIME", nullable = false, length = 100)
    public String getMime() {
        return this.mime;
    }

    public void setMime(String mime) {
        this.mime = mime;
    }

    @Column(name = "EXP_DOC_TITLE", length = 150)
    public String getTitle() {
        return this.title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    @Column(name = "EXP_DOC_KEYS", length = 254)
    public String getKeys() {
        return this.keys;
    }

    public void setKeys(String keys) {
        this.keys = keys;
    }

}
